package hotel;

import java.sql.Date;
import java.util.Iterator;
import java.util.LinkedList;

public class MyResultSet{
	private LinkedList<String[]> l;
	private Iterator<String[]> it;
	private String[] corrente;
	private int acc=0;
	public MyResultSet(){
		l=new LinkedList<String[]>();
	}
	public void add(String[] a){
		l.add(a);
	}
	public boolean next(){
		if(acc==0) it=l.iterator();
		if(!it.hasNext()) return false;
		corrente=it.next();
		acc++;
		return true;
	}
	public String getString(int i){
		try{
			return corrente[i-1];
		}catch(Exception e){
			return "";
		}
	}
	public int getColoumnCount(){
		return corrente.length;
	}
	public boolean getBoolean(int i){
		return Boolean.getBoolean(corrente[i-1]);
	}
	public int getInt(int i){
		return Integer.parseInt(corrente[i-1]);
	}
	public Date getDate(int i){
		return Date.valueOf(corrente[i-1]);
	}
	public int getRow(){
		return l.size();
	}
	
	
}
